home *** CD-ROM | disk | FTP | other *** search
/ Commodore Free 11 / Commodore_Free_Issue_11_2007_Commodore_Computer_Club.d64 / t.iv glenn < prev    next >
Text File  |  2023-02-26  |  9KB  |  334 lines

  1. u           POWER c compiler
  2.              Glenn Holmer
  3.           (Q-Link: ShadowM)
  4.  
  5.  http://www.lyonlabs.org/commodore/
  6.   c64.html
  7.  
  8. Q-Please introduce yourself to our
  9. readers
  10.  
  11. A-My name's Glenn Holmer, a Java prog-
  12. rammer living in Milwaukee, WI (USA).
  13. I've been a programmer & a C= user for
  14. 20 years, & have a web page at http:/
  15.  /www.lyonlabs.org/commodore/c64.html.
  16.  
  17. Q-Can you give some brief info on your
  18. computing background & how you came
  19. across the C= Brand?
  20.  
  21. A-My first job with computers was as an
  22. operator on an IBM 4331. All the
  23. applications in our shop were written
  24. in BAL assembler & I couldn't figure it
  25. out, so I thought I'd buy a computer of
  26. my own to see if it would help (it did)
  27. I picked the C64 because of its sound
  28. capabilities & have been in love ever
  29. since.
  30.  
  31. Q-Please explain to our reader what
  32. "power c" is & what the C
  33. programming language is
  34.  
  35. A-C was developed in the early 1970's &
  36. was intended as a substitute for
  37. assembly language that was faster &
  38. easier to code. Power C is a C 64/128
  39. C compiler, released by Spinnaker in
  40. 1986; an earlier version by Pro-Line in
  41. Canada was known as C Power.
  42.  
  43. Q-Can you give our reader a brief
  44. syntax from basic to C, maybe a count
  45. down timer so they can see the format
  46. of the C programming language
  47.  
  48. A-Sure... here it is in BASIC:
  49.  
  50. 10 FOR I = 10 TO 0 STEP -1
  51. 20 PRINT I
  52. 30 NEXT
  53. 40 PRINT "BLAST-OFF!"
  54.  
  55. and in C:
  56.  
  57. int main
  58. (argc, argv)
  59. int argc;
  60. char **argv; [
  61.  int i;
  62.  for (i = 10; i >= 0; i--) [
  63.  printf("%d\n", i);
  64.  ]
  65.  puts("BLAST-OFF!"); ]
  66.  
  67. Q-Do you think in your opinion C
  68. programming language is easier than say
  69. C= Basic or another language?
  70.  
  71. A-As you can see from the example
  72. above, C is more difficult. This
  73. becomes more apparent as you begin to
  74. work with other features of the
  75. language like structures & pointers.
  76. On the other hand, as the saying goes,
  77. with knowledge comes power!
  78.  
  79. Q-one of the benefits of C programming
  80. language is that it is "portable" can
  81. you explain the term & how "portable"
  82. is the power C code
  83.  
  84. A-Since C is a very simple language &
  85. relies on libraries for much of its
  86. functionality, compilers can be written
  87. for different machines that can take
  88. the same source file & produce a work-
  89. ing program specific to the machine at
  90. hand. Power C code is not quite so
  91. portable to other machines because it
  92. uses an older dialect known as "K&R".
  93.  
  94. Q-Is C language an industry standard?
  95.  
  96. A-It has become less common for prog-
  97. rammers to know C; now they are more
  98. likely to know C++ or Java. But C is
  99. still everywhere, & the syntax of C++ &
  100. Java are based on it.
  101.  
  102. Q-I remember reading that the original
  103. C= Amiga libraries were written in c
  104. also C is heavily used in the PC & Unix
  105. world. If learning Power C would the
  106. same principles apply to other formats
  107. of machines
  108.  
  109. A-Absolutely. As I said, Power C uses
  110. an older dialect, but what you learn
  111. about pointers & so forth would
  112. definitely carry over.
  113.  
  114. Q-What makes "Power C" an appealing
  115. language, & why utilise this on C=
  116. machines
  117.  
  118. A-There is something about the syntax
  119. of C that is very seductive: it is
  120. compact & expressive at the same time.
  121. Once you learn it well,you can code
  122. very fast, which makes it appealing to
  123. use on a C=.
  124.  
  125. Assembly language takes too long to
  126. code, & higher level languages like
  127. Pascal or COBOL take too much memory.
  128.  
  129. Q-What is SWL?
  130.  
  131. A-SWL is "Shadow's Widget Library".
  132. Shadow is my nickname, & SWL is a set
  133. of Power C libraries I wrote that are
  134. designed to make it easy to create
  135. sophisticated user input screens from
  136. Power C.
  137.  
  138. Q-Is this a labour of love or do you
  139. know people are actively using the
  140. language & the extra extensions you
  141. have created
  142.  
  143. A-I only released the SWL libraries
  144. a week ago (although I did talk about
  145. them at the C=4 Expo in Cincinnati), so
  146. I don't suppose there are lots of
  147. people using them yet! I have been in
  148. contact with several other people who
  149. are using Power C both here & abroad,
  150. but would like to see it used more,
  151. because its libraries are so easy to
  152. share.
  153.  
  154. Q-Please tell our reader about Power
  155. c extensions,
  156.  
  157. A-Power C source files are compiled
  158. into object files, & object files are
  159. linked together to form executable
  160. programs. You may have to link your
  161. object file with several others to
  162. complete that process. But if several
  163. object files are used to build a
  164. library, you need only tell the linker
  165. the library name, & it will find all
  166. the entry points in all the associated
  167. object files by name. If you link a
  168. program against the SWL object code,
  169. for example, you may have to type in
  170. the names of up to six files at the
  171. linker prompt. But if you use the
  172. library, you only type "swl.l", & the
  173. linker includes what it needs from all
  174. 6 of them.
  175.  
  176. Q-What are widgets
  177.  
  178. A-This is an old term that refers to
  179. the elements that make up a user inter-
  180. face: text input fields, checkboxes,
  181. etc.
  182.  
  183. Q-Are all the extension to power C on
  184. your page created by yourself
  185.  
  186. A-Not at all! Everything in the down-
  187. loads section on my site was written by
  188. other programmers in the heyday of
  189. Power C & the C=. The only code that's
  190. mine is SWL & the drive enumeration &
  191. relative file support routines that
  192. come with it. I hope there wasn't any
  193. confusion about that, but I've added
  194. all the authors' names next to the
  195. links.
  196.  
  197. Q-Is the Compiled c language as fast as
  198. machine code
  199.  
  200. A-Almost.
  201.  
  202. Q-What does it take to use Power C?
  203.  
  204. A-While you can write & compile
  205. programs using a single 1541 drive, the
  206. more power you throw at it, the better.
  207. Compiles of long programs can take
  208. quite some time, so if you can get your
  209. hands on them, I would recommend a
  210. SuperCPU & a CMD hard drive or two.
  211.  
  212. Q-Where wouldn't Power C be a good
  213. language to use for example could Games
  214. be written in the language or is C
  215. designed for business applications
  216.  
  217. A-I think you could use it for just
  218. about any type of application. The
  219. limiting factor would be the memory
  220. usage. Compiled C on the C= is pretty
  221. fast, but takes up a lot of memory.
  222. Most of the time I spent developing SWL
  223. was spent translating earlier versions
  224. written in C into assembly so a program
  225. using them would still fit!
  226.  
  227. Q-You seem to be a collector of
  228. operating system & interpreters &
  229. compilers for Commodore machines, is
  230. this some obsession, & why the
  231. fascination
  232.  
  233. A-Yes, it's an obsession! I will never
  234. have enough compilers! Send me more
  235. that I may feed upon them & grow
  236. strong! Seriously, I've always been
  237. fascinated with languages, both spoken
  238. & computer. I would like to give a
  239. presentation at one of the C= expos
  240. about what languages are available, but
  241. have become very focused on mastering
  242. Power C.
  243.  
  244. Q-What is your favorite C= operating
  245. system & compiler/interpreter & why
  246.  
  247. A-For compilers, it's Power C, no
  248. doubt about that. Operating system is
  249. a little more complicated. I like the
  250. idea of Contiki, but it is, shall we
  251. say, not particularly robust. I'm
  252. interested in learning more about
  253. LUnix, which was an attempt at writing
  254. a multitasking Unix-like operating
  255. system for the C=
  256.  
  257. Q-What would be your least favorite &
  258. why
  259.  
  260. A-C= BASIC, I guess! The '64 doesn't
  261. have much of an operating system, or I
  262. would put that in the same category.
  263. The C=64 just begs to have new tools
  264. created for it!
  265.  
  266. Q-You said in a recent email you were
  267. releasing "version 1.00 of the SWL
  268. libraries", are there more to come or
  269. will you concentrate on making these as
  270. bug free & compact as possible
  271.  
  272. A-The next step is to write an
  273. application based on SWL. This is
  274. actually why I wrote the libraries in
  275. the first place: I wanted to write a
  276. Power C app but didn't want to re-
  277. invent the wheel if I decided I wanted
  278. to use the input routines again later.
  279. It was a detour of many months, but now
  280. that I'm actually writing the
  281. application, it's going very quickly.
  282. I'd love to see people use (or at
  283. least try) SWL, & I welcome bug
  284. reports. In my dreams, I also see a
  285. community of Power C programmers
  286. sharing sound, networking, & graphics
  287. libraries they have written. A lot of
  288. resources are available on my Power C
  289. page,
  290.  
  291.  http://www.lyonlabs.org/commodore/
  292.   powerc.html.
  293.  
  294. Q-Are there any applications written in
  295. power C especially utilising these ext-
  296. ensions our readers can download to
  297. look at what is achievable
  298.  
  299. A-Come to ECCC in Chicago on SEP 27 :)
  300.  
  301. Things that are being considered for
  302. the next version: (bug) banner text
  303. centered wrong (one character to the
  304. right)  doList() should show a title
  305. if one is passed  menus should support
  306. paging, or at least home/shifthome
  307. allow for scrolling single- line text
  308. entry (and maybe labels) when there is
  309. more text than can be displayed  for
  310. drive routines, add functions to send
  311. disk command & read error channel
  312. (already in my working copy) I'm also
  313. working on a replacement for Power C's
  314. malloc() & free() functions, because
  315. they use a first- fit algorithm that
  316. leaks memory; a program that repeatedly
  317. allocates & frees large numbers of SWL
  318. "objects" will find itself out of
  319. memory very quickly (the worst-case
  320. scenario is a program that repeatedly
  321. reads CMD directories into a menu
  322. structure, then frees the directory
  323. entries & menu items & allocates new
  324. ones as the directory tree is
  325. traversed). Naturally, that's turning
  326. into a saga of mythic proportions. To
  327. find out all the gory details (inc-
  328. luding a snapshot of the source code),
  329. offer suggestions, or just tell me I'm
  330. crazy to be doing this, visit my web log...
  331.  
  332.  http://www.lyonlabs.org/roller/shadow/
  333.   entry/swlDshadowDsDwidgetDlibrary
  334.